<template>
  <fragment>
    <template v-for="(v, k) in menuList">
        <el-submenu v-if="v.children && v.children.length > 0" :index="v.path" :key="v.path">
          <template slot="title">
            <i :class="v.icon"></i>
            <span style="font-size: 15px; font-weight: 600;" slot="title">{{v.label}}</span>
          </template>
          <menu-item :menuList="v.children" />
        </el-submenu>

        <el-menu-item v-else :index="v.path" :key="v.path">
          <i :class="v.icon"></i>
          <span slot="title">{{v.label}}</span>
        </el-menu-item>
    </template>
  </fragment>
</template>

<script>
  import MenuItem from './MenuItem'

  export default {
    name: 'MenuItem',
    props: ['menuList'],
    components: {
      MenuItem
    },
    data () {
      return {

      }
    }
  }

</script>

<style scoped>

</style>